<?php
declare (strict_types = 1);

namespace app\model\communal;

use think\db\Query;
use think\Model;

/**
 * Class app\model\communal\UserExpertFollowModel
 *
 */
class UserExpertFollowModel extends Model
{
    /**
     * 状态
     */
    const IS_FOLLOW_ONE = 1; // 关注
    const IS_FOLLOW_TWO = 2; // 未关注

    /**
     * 数据库配置
     *
     * @var string
     */
    protected $connection = 'communal';

    /**
     * 主键
     *
     * @var string
     */
    protected $pk = 'user_id,expert_id';

    /**
     * 表名
     *
     * @var string
     */
    protected $table = '55100_user_expert_follow';

    /**
     * 自动时间戳
     *
     * @var bool
     */
    protected $autoWriteTimestamp = true;

    /**
     * 时间字段设置
     *
     * @var string
     */
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';

    /**
     * 展示字段名
     *
     * @var string[]
     */
    public static $column = ['user_id', 'expert_id', 'created_at'];

    /**
     * 搜索字段名
     *
     * @var string[]
     */
    public static $searchColumn = ['user_id'];

    /**
     * 新增字段
     *
     * @var string[]
     */
    public static $saveColumn = [
        'user_id', 'expert_id',
    ];

    /**
     * 更新字段
     *
     * @var string[]
     */
    public static $updateColumn = [
        'user_id', 'expert_id',
    ];
}
